package com.seari.enums;

import org.apache.commons.lang3.StringUtils;

public enum WeekDayEnum {
	MON(1,"星期一"),
	TUE(2,"星期二"),
	WED(3,"星期三"),
	THU(4,"星期四"),
	FRI(5,"星期五"),
	SAT(6,"星期六"),
	SUN(0,"星期日");
	
    private int code;
    private String value;

    private WeekDayEnum(int code,String value){
        this.code = code;
        this.value = value;
    }
    
    public String getValue() {
    	return value;
    }
    
    public int getCode() {
    	return code;
    }
    
    public static WeekDayEnum getWeekDayEnumByCode(int code){
        for(WeekDayEnum weekDayEnum : WeekDayEnum.values()){
          if(StringUtils.equals(code+"", weekDayEnum.getCode()+"")){
            return weekDayEnum;
          }
        }
        return null;
      }
}
